//
//  BKGestureWebView.h
//  BukaLive
//
//  Created by 曹飞 on 2018/1/18.
//  Copyright © 2018年 曹飞. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#import "BKBaseGestureRecognizerView.h"
#import "BKPPTPageView.h"
#import "BKPlayerAudioView.h"
#import "BKPlayerVideoView.h"

static NSString * const kNotificationCloseWebView = @"closeWebView";

typedef NS_ENUM(NSInteger,BKGestureWebViewType) {
    
    BKGestureWebViewTypeH5Normal,         //h5 小窗
    BKGestureWebViewTypeH5All,            //h5 全屏幕
    BKGestureWebViewTypeVideoNormal,      //视频 小窗 二路流
    BKGestureWebViewTypeVideoAll,         //视频 全屏幕 二路流
    BKGestureWebViewTypeMediaVideo,        //媒体音视频
    BKGestureWebViewTypeMediaAudio,          //媒体音频
    BKGestureWebViewTypeMoveWhite,          //移动白板
};

typedef NS_ENUM(NSInteger,BKGestureWebViewUser){
    BKGestureWebViewUserTeacher,
    BKGestureWebViewUserStudent
};


@class BKGestureWebView;

typedef void (^BKGestureWebViewWebJSCompletionHandler)(void);
typedef void (^BKGestureWebViewDidReceiveScriptMessage)(BKGestureWebView * touchWebView, WKWebView *webView, WKUserContentController *userContentController,WKScriptMessage * message);
typedef void (^BKGestureWebViewRunJavaScriptAlertPanelWithMessage)(WKWebView *webView,NSString *message,WKFrameInfo * frame,BKGestureWebViewWebJSCompletionHandler completionHandler);
typedef void (^BKTempDidWebCloseBtn)(BKHtmlPptModel *pptModel); //点击web上关闭按钮把model传出去
typedef void (^BKGestureWebViewMoveEnd)(id view, CGRect moveFrame, CGRect superViewFrame);
typedef void (^BKGestureWebViewLargeOrShrinkBlock)(id view);
typedef void(^BKGestureWebViewEditStatus)(BOOL isEdit,BKGestureWebView * view);

@interface BKGestureWebView : UIView

@property (nonatomic,assign) BOOL canDoubleTap;

@property (nonatomic,strong) BKHtmlPptModel * pptModel;
@property (nonatomic,strong) BukaStatus * status;

@property (nonatomic,assign) BKGestureWebViewUser userType; //先设置User类别
@property (nonatomic,assign) BKGestureWebViewType viewType; //再设置样式

@property (nonatomic,strong) BKPlayerAudioView * playerAudioView;
@property (nonatomic,strong) BKPlayerVideoView * playerVideoView;

@property (nonatomic,strong) WKWebView * webView;
@property (nonatomic,strong) UIView * contentType3VideoView;
@property (nonatomic,strong) UILabel * titleLB;
@property (nonatomic,strong) UIView * grayLine;
@property (nonatomic,strong) UILabel * grayLB; //普通文档显示一个标题,根据手指点击显示3秒,视频不显示


@property (nonatomic,strong) BKButton * nextBtn;          //控制H5文档下一页
@property (nonatomic,strong) BKButton * previousBtn;      //控制H5文档上一页
@property (nonatomic,strong) BKButton * closeBtn;

@property (nonatomic,strong) BKPPTPageView  * pageView;   //页号

@property (nonatomic,copy) BKTempDidWebCloseBtn webPptBlock;
@property (nonatomic,copy) BKGestureWebViewMoveEnd moveEndBlock;

@property (nonatomic,copy) BKBaseGestureRecognizerViewTap tapBlock;


@property (nonatomic,copy) BKGestureWebViewLargeOrShrinkBlock largeOrShrinkBlock;
@property (nonatomic,copy) BKGestureWebViewEditStatus editBlock;

@property (nonatomic,copy) BKGestureWebViewDidReceiveScriptMessage               receiveScriptMessageBlock;
@property (nonatomic,copy) BKGestureWebViewRunJavaScriptAlertPanelWithMessage    runJavaScriptAlertPanelWithMessageBlock;


@property (nonatomic,copy) BKPlayerAudioViewPlayTimeBlock audioTimeBlock;
@property (nonatomic,copy) BKPlayerVideoViewPlayTimeBlock videoTimeBlock;


-(void)closeEdit;
-(void)canMove:(BOOL)canMove;

//释放时被动关闭的情况下，需要调用
-(void)resetView;
@end
